/************************************************************************************
Note: These tests take a while to run, so I put them in their own class. After running 
this test you'll have a left over app server running from cloud-tools-clone
*************************************************************************************/
class LongTests extends CloudToolsBaseTests{
	
	void setUp(){
		super.setUp()
		executeGrailsCommand("cloud-tools-deploy", null)
	}
	
	void tearDown(){
		executeGrailsCommand("cloud-tools-stop", null)
	}
	
	void testAddAppServerRedeployClone(){
		
		//test for redeploy
		def result = executeGrailsCommand("cloud-tools-redeploy", null)
		assertExitValue(0, result);
	    assertStdOut("Finished redeploying cluster", result);
	
		//test for bad clone
		result = executeGrailsCommand("cloud-tools-clone", null)
		assertExitValue(0, result);
	    assertStdErr("A cluster name was not specified.  Example:", result);
	
		//test for clone
		result = executeGrailsCommand(" -Dcloudtools.new.cluster.name=test-clone cloud-tools-clone", null)
		assertExitValue(0, result);
	    assertStdOut("Finished cloning cluster", result);
	
		//test add app server
		result = executeGrailsCommand("cloud-tools-add-app-server", null)
		assertExitValue(0, result);
	    assertStdOut("Finished adding 1 server(s)", result);
	}
	
}